package org.kms.utils;

import java.io.Serializable;

public class ResponseResult<T> implements Serializable {
    private T data;
    private Long count;
    private int code;
    private String msg;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public ResponseResult(T data, Long count, int code, String msg) {
        this.data = data;
        this.count = count;
        this.code = code;
        this.msg = msg;
    }

    public ResponseResult(T data, Long count) {
        this.data = data;
        this.count = count;
        this.msg = "";
        this.code=0;
    }

    public ResponseResult(T data) {
        this.data = data;
        this.count = 0L;
        this.msg = "";
        this.code=0;
    }

    public ResponseResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResponseResult createSuccessResult(){
        return new ResponseResult(0,"");
    }
}
